@import '../color.scss';

.zhui-input {
  box-sizing: border-box;
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 80px;
  height: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 4px 10px;
  background-image: none;
  border: 0;
  transition: all .1s ease-in;
  -webkit-appearance: none;
  background: #fff;
  border: 4px solid $meihong;
  outline: $meihong dashed 1px;
  outline-offset: -8px;

  &:focus, &:hover {
    outline-offset: -3px;
  }

  &::-webkit-input-placeholder {
    color: rgba(0,0,0,0.65);
  }

  &-wrapper {
    position: relative;
    width: 200px;
    height: 45px;

    &-large {
      height: 58px;
      
      .zhui-input-group-addon {
        line-height: 58px;
      }

      > .zhui-input { font-size: 16px; }
    }

    &-small {
      height: 32px;
      font-size: 12px;

      .zhui-input-group-addon {
        line-height: 32px;
      }

      > .zhui-input { font-size: 12px; }
    }
  }

  &-group {
    display: flex;

    &-addon {
      box-sizing: border-box;
      display: inline-block;
      height: 100%;
      font-size: 12px;
      line-height: 45px;
      min-width: 20px;
      text-align: center;
      vertical-align: middle;
      color: #fff;
      background: $meihong;

      &:first-child {
        border-top-left-radius: 50px;
        border-bottom-left-radius: 50px;
        padding-left: 8px
      }

      &:last-child {
        border-top-right-radius: 50px;
        border-bottom-right-radius: 50px;
        padding-right: 6px;
      }
    }

    .zhui-input {
      flex: 1;
      border-radius: 0;
    }
  }

  &-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 10px;
    z-index: 1;
    transform: translateY(-50%);
    margin-top: -0.15em;

    .zhuiicon {
      font-size: 16px;
    }

    + .zhui-input {
      padding-left: 25px;
    }
  }

  &-textarea-wrapper {
    display: inline-block;
    height: auto;
    width: 240px;
    height: 100px;
    min-height: 32px;
    
    .zhui-input-textarea {
      box-sizing: border-box;
      width: 100%;
      height: 100%;
      border-radius: 2px;
      padding: 8px 10px;
      transition: all .1s linear;
      background: #fff;
      border: 3px solid $meihong;
      outline: $meihong dashed 1px;
      outline-offset: -8px;
      resize: none;

      &:focus, &:hover {
        outline-offset: -3px;
      }
    }
  }

  @each $key, $value in $color-list {
    &-#{$key} {
      border: 4px solid $value !important;
      outline: $value dashed 1px !important;
    }
  }

  &-disabled, &-disabled {
    outline: none !important;
    border-color: $inputBorder !important;
    cursor: not-allowed;

    + .zhui-input-group-addon {
      display: none;
    }
  }
}